﻿using Microsoft.AspNetCore.Mvc;
using PrivateTracker.Service.Core;

namespace PrivateTracker.Service.Application;
/// <summary>
/// 
/// </summary>
public interface ITorrentService
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="torrentInput"></param>
    /// <returns></returns>
    Task<TorrentOutput> AddAsync(TorrentInput torrentInput);
    /// <summary>
    /// 
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task DeleteAsync(DeleteTorrentInput input);
    /// <summary>
    /// 
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task<TorrentOutput> GetAsync(long id);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="hashInfo"></param>
    /// <param name="tenantId"></param>
    /// <returns></returns>
    Task<Torrent> GetAsync(string hashInfo, long? tenantId);
    /// <summary>
    /// 
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<PageResult<TorrentOutput>> QueryTorrentPageList([FromQuery] TorrentPageInput input);
    /// <summary>
    /// 修改做种数量
    /// </summary>
    /// <param name="hashInfo"></param>
    /// <param name="tenantId"></param>
    /// <param name="count"></param>
    /// <returns></returns>
    Task UpdaeCompleteCountAsync(string hashInfo, long? tenantId, int count = 1);
    /// <summary>
    /// 未完成的数量
    /// </summary>
    /// <param name="hashInfo"></param>
    /// <param name="tenantId"></param>
    /// <param name="count"></param>
    /// <returns></returns>
    Task UpdaeInCompleteCountAsync(string hashInfo, long? tenantId, int count = 1);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<IActionResult> DownloadTorrent([FromQuery] QueryFileInfoInput input);
}
